﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace shopform
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void Main_Load(object sender, EventArgs e)
        {
            this.Text =
                "ShopForm Management :: " +
                myAuthenticator.getName() +
                " :: " +
                myAuthenticator.getType();
        }

        /// <summary>
        /// When Exit Button is clicked we logoff using myAuthenticator
        /// and close the database connection.
        /// Finally we Exit the Application.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainMenuExit_Click(object sender, EventArgs e)
        {
            String exitConfText = "Biztosan ki szeretnel lepni?";
            String exitConfWName = "Kilepes";
            if (
                MessageBox.Show(exitConfText, exitConfWName, MessageBoxButtons.YesNo) 
                ==
                DialogResult.Yes
               )
            {
                myAuthenticator.logoff();
                myDatabaseConnection.connectionClose();
                Application.Exit();
            }
        }

        private void KliensekSMenuUj_Click(object sender, EventArgs e)
        {
            Form aNewClientForm = new NewClientForm();
            aNewClientForm.Show();
        }

        private void ujToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aNewCompanyReferentForm = new NewCompanyReferentForm();
            aNewCompanyReferentForm.Show();
        }

        private void adatokModositasaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aModifyClientForm = new ModifyClientForm();
            aModifyClientForm.Show();            
        }

        private void modositToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aModifyClientReferentForm = new ModifyClientReferentForm();
            aModifyClientReferentForm.Show();
        }

        private void torolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aDeleteClientReferentForm = new DeleteCompanyReferentForm();
            aDeleteClientReferentForm.Show();
        }

        private void ujToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Form aNewProjectForm = new NewProjectForm();
            aNewProjectForm.Show();
        }

        private void listazasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aProjectMenu = new ProjectMenu();
            aProjectMenu.Show();
        }

        private void hozzaadasaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aNewCurrencyForm = new NewCurrencyForm();
            aNewCurrencyForm.Show();
        }

        private void arfolyamToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aCurrencyChooser = new CurrencyChooser();
            aCurrencyChooser.Show();
        }

        private void termekmenedzsmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form aProductAdminMenu = new ProductsAdminMenu();
            aProductAdminMenu.Show();
        }

    }
}
